#include<stdio.h>
#include<vector>
#include<algorithm>
using namespace std;
class Caketown
{
public:
	int howManyBites(vector <int> cakeSize, int numFriends)
	{
		int sum = 0;
		sort(cakeSize.begin(),cakeSize.end());
		for(int j=0,i = cakeSize.size()-1;i>=0;j++,i--)
		{
			if(j%(numFriends+1) == 0)
				sum += cakeSize[i];
		}
		return sum;
	}
};
